package cn.amos.gateway.exception;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * PROJECT: ws-gateway
 * DESCRIPTION: 异常拦截
 *
 * @author amos
 * @date 2019/4/13
 */
@org.springframework.web.bind.annotation.ControllerAdvice
public class ExceptionAdvice {

    @ExceptionHandler(Throwable.class)
    @ResponseBody
    public String exception(Throwable throwable) {
        return "Request Fail, Exception By " + throwable.getMessage();
    }

}
